#include "process.h"
#include <stdio.h>
#include <string.h>
#include <unistd.h>


#define NUM 101
#define STYLE1 '='
#define STYLE2 '>'

void Process()
{
    const char lable[] = "|/-\\";
    char bar[NUM];
    memset(bar,'\0',sizeof(bar));
    int len = strlen(lable);
    int cnt = 0;
    while(cnt <= 100)
    {
        bar[cnt] = STYLE2;
        printf("[%-100s][%d%%][%c]\r",bar,cnt,lable[cnt%len]);
        fflush(stdout);
        usleep(100000);
        bar[cnt] = STYLE1;
        printf("[%-100s][%d%%][%c]\r",bar,cnt,lable[cnt%len]);
        fflush(stdout);
        cnt++;

        usleep(20000);
    }
    printf("\n");

}
